/***************************************************************************
 *   Copyright (C) 2008 by Marco Gulino   *
 *   marco.gulino@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA            *
 ***************************************************************************/
#include "qfakefileinfo.h"
#include "qfakedir.h"


QFakeFileInfo::QFakeFileInfo(): QFileInfoInterface( QFileInfo() ),
                             s_path(QString()), l_size(0), b_isFile(true), b_isDir(false)
{
}


QFakeFileInfo::~QFakeFileInfo()
{
}

QFakeFileInfo* QFakeFileInfo::setFilePath(const QString &path)
{
    this->s_path=path;
    return this;
}

QFakeFileInfo* QFakeFileInfo::setSize(qint64 size)
{
    this->l_size=size;
    return this;
}

QFakeFileInfo* QFakeFileInfo::setIsFile(bool isFile)
{
    this->b_isFile=isFile;
    this->b_isDir=!isFile;
    return this;
}

QFakeFileInfo* QFakeFileInfo::setIsDir(bool isDir)
{
    this->b_isDir=isDir;
    this->b_isFile=!isDir;
    return this;
}

bool QFakeFileInfo::isDir() const
{
    return b_isDir;
}

bool QFakeFileInfo::isFile() const
{
    return b_isFile;
}

QString QFakeFileInfo::filePath() const
{
    return s_path;
}

qint64 QFakeFileInfo::size() const
{
    return l_size;
}

QDirInterface *QFakeFileInfo::dir() {
    return new QFakeDir(filePath() );
}
